<template>
    <div>
        <div align="center">
            <el-button size="small" type="primary" @click="deleteHandle()">删除</el-button>
        </div>
        <div>
            <el-table
                    :data="tableData"
                    :show-header="false"
                    stripe
                    style="width: 100%">
                <!--<el-table-column prop="line" width="45" align="center"></el-table-column>-->
                <el-table-column prop="trace"></el-table-column>
            </el-table>
        </div>
    </div>
</template>

<script>

    /*错误栈*/

    export default {
        mounted() {
            this.loadData();
        },
        components: {},
        props: {
            logId: {
                required: true,
                type: Number
            }
        },
        data() {
            return {
                tableData: []
            }
        },
        computed: {},
        methods: {
            deleteHandle() {
                this.$emit("deleteHandle", {id: this.logId});
            },
            loadData() {
                this.$ajax('logback/stack/' + this.logId).then(res => {
                    if (res.code !== 0) {
                        this.$message.error(res.msg);
                    } else {
                        this.tableData = res.data;
                    }
                });
            }
        },
        watch: {
            logId: function () {
                this.loadData();
            }
        },
        filters: {},
        beforeDestroy() {
        }
    }
</script>

<style scoped>

</style>
